package com.biboheart.adapter.express.support;

import com.biboheart.adapter.express.operation.Logical;

import java.math.BigDecimal;

final class LogicalEqualNotCalculate implements Logical {
    @Override
    public Boolean calc(Object left, Object right) {
        if ((left instanceof Number) && (right instanceof Number)) {
            return new BigDecimal(String.valueOf(left)).compareTo(new BigDecimal(String.valueOf(right))) != 0;
        }
        return !String.valueOf(left).equals(String.valueOf(right));
    }

    @Override
    public Boolean calc(Boolean source) {
        return false;
    }
}
